<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

    <script type="text/javascript" src="http://res.mywdk.com/utils/jshashtable.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script src="../jqc.core.js" type="text/javascript"></script>

    <script src="../jqc.commandqueue.js" type="text/javascript"></script>

    <script type="text/javascript">

        var cmd1 = new jqCommons.queues.AbstractCommand();
        cmd1.execute = function() {
            console.log('doing something at command #1');
            cmd1.onCommandComplete();
        };

        var cmd2 = new jqCommons.queues.AbstractCommand();
        cmd2.execute = function() {
            console.log('doing something at command #2');
            cmd2.onCommandComplete();
        };

        var q = new jqCommons.queues.CommandQueue();
        q.addCommand([cmd1, cmd2]);

        $(window).bind(jqCommons.queues.Events.COMPLETE, function(e) {
            console.log('done====');
        });

        $(window).bind(jqCommons.queues.Events.PROGRESS, function(e) {
            console.log(e);
        });

        q.execute();

    </script>

</head>
<body>
</body>
</html>
